package com.example.administrator.scan2web;

import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.EditText;
import android.widget.Toast;

import com.google.zxing.android.CaptureActivity;

public class SplashActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
    }

    @Override
    protected void onResume() {
        super.onResume();
        Intent intent = new Intent(this, MainActivity2L.class);
        startActivityForResult(intent, 10);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        Log.e("test","two");
        if (resultCode == RESULT_OK){
            Log.e("test","three");
            String url = data.getStringExtra("text");
            Log.e("test",url);
            String result = "http://demo.companyhf.com:8001/s.aspx?key="+url;
            Intent intent = new Intent(SplashActivity.this,WebActivity.class);
            intent.putExtra("url",result);
            startActivity(intent);
        }
    }
}
